package t1;

import java.sql.SQLOutput;

public class text {
    public static void main(String[] args) {
        USB demo1=new USB() {
            @Override
            public void startwork() {
                System.out.println("开始工作");
            }

            @Override
            public void stopwork() {
                System.out.println("停止工作");
            }

        };
        Computer.useUSB(new KeyBord());
        Computer.useUSB(new Mouse());

    }
    static class Computer{
        public static void useUSB(USB useDevice){
           useDevice.startwork();
           useDevice.stopwork();
        }
    }
}
